package com.xuecheng.content.controller;

import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.content.service.TeachplanWorkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
@RequestMapping
public class TeachplanWorkController {

    @Autowired
    private TeachplanWorkService teachplanWorkService;

    @GetMapping("l/teachplan/work/{workId}")
    public RestResponse getTeachplanWorkById(@PathVariable Long workId) {
        return teachplanWorkService.getCountByWorkId(workId);
    }

    @GetMapping("l/teachplan/association/{workId}")
    public RestResponse<Set<String>> getWorkAssociationPlanName(@PathVariable Long workId) {

        return teachplanWorkService.getWorkAssociationPlanName(workId);
    }
}
